<html>
<head><meta charset="utf-8"><title>implied-bounds · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html">implied-bounds</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="136733805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136733805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136733805">(Oct 29 2018 at 20:40)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> re</p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nb">Send</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">U</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span>: <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="136733826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136733826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136733826">(Oct 29 2018 at 20:41)</a>:</h4>
<p>to me this is no different than</p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="nb">Copy</span>: <span class="nb">Clone</span> <span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">Self</span>: <span class="nb">Copy</span> <span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="136733837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136733837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136733837">(Oct 29 2018 at 20:41)</a>:</h4>
<p>if we make the first example ill-formed under the pretext that <code>Self: Foo&lt;T&gt;</code> is ill-formed, so should we do with the second example <code>Self: Copy</code></p>



<a name="136733888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136733888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136733888">(Oct 29 2018 at 20:42)</a>:</h4>
<p>so to me, in traits we don't need to check any where clauses, but impls must always enforce the full set of transitive bounds</p>



<a name="136783506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136783506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136783506">(Oct 30 2018 at 15:21)</a>:</h4>
<p>ok I see -- yes <span class="user-mention" data-user-id="131694">@scalexm</span> you make a persuasive case :)</p>



<a name="136783517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136783517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136783517">(Oct 30 2018 at 15:21)</a>:</h4>
<p>we currently do have some sort of WF checks here</p>



<a name="136783518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136783518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136783518">(Oct 30 2018 at 15:21)</a>:</h4>
<p>however</p>



<a name="136783572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136783572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136783572">(Oct 30 2018 at 15:22)</a>:</h4>
<p>but I think that -- under an implied bounds scheme -- they are largely silly</p>



<a name="136785024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136785024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136785024">(Oct 30 2018 at 15:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes</p>



<a name="136785031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136785031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136785031">(Oct 30 2018 at 15:43)</a>:</h4>
<p>If you check the WF chapter I juste wrote in rustc-guide</p>



<a name="136785090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136785090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136785090">(Oct 30 2018 at 15:44)</a>:</h4>
<p>For trait decls, the only things I check are that types appearing in the where clauses are WF</p>



<a name="136791124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791124">(Oct 30 2018 at 17:10)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> ok I will consult. Of course, <em>today</em> this <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2015&amp;gist=0d4391ae577761238eb5bed021c362f6" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2015&amp;gist=0d4391ae577761238eb5bed021c362f6">gets an error</a></p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nb">Send</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span>: <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="136791171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791171">(Oct 30 2018 at 17:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes :) but since the WF chapter is in the "new-style" trait solving section, I wrote things as how I think they should be tomorrow</p>



<a name="136791255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791255">(Oct 30 2018 at 17:12)</a>:</h4>
<p>yep yep</p>



<a name="136791260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791260">(Oct 30 2018 at 17:12)</a>:</h4>
<p>I'm not saying that to "contradict" you, just noting</p>



<a name="136791265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791265">(Oct 30 2018 at 17:12)</a>:</h4>
<p>it feels maybe relevant to the trait alias PR that <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> has been working on</p>



<a name="136791274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791274">(Oct 30 2018 at 17:12)</a>:</h4>
<p>I am basically thinking that we should make trait aliases "fit" the rest of the system as cleanly as we can</p>



<a name="136791279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791279">(Oct 30 2018 at 17:12)</a>:</h4>
<p>which might mean inheriting its limitations for the time being</p>



<a name="136791286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136791286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136791286">(Oct 30 2018 at 17:13)</a>:</h4>
<p>but I am debating if that is silly</p>



<a name="136936161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936161">(Nov 01 2018 at 17:24)</a>:</h4>
<p>Picking this up again, <span class="user-mention" data-user-id="131694">@scalexm</span>, I basically can't come up with any reason that we should impose limitations on trait aliases (cc <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>) that they be "consistent". In other words, it seems ok to permit <code>trait Foo&lt;T: Send { }; trait Bar&lt;T&gt; = Foo&lt;T&gt;;</code>, and not require <code>trait Bar&lt;T: Send&gt; = Foo&lt;T&gt;</code>.</p>
<p>The way this is implemented, you basically wind up with roughly the equivalent of</p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="o">&lt;</span><span class="n">Self</span>: <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Self</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">..</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>I was trying to figure out if there could be problems like those from <a href="https://github.com/rust-lang/rust/issues/43784" target="_blank" title="https://github.com/rust-lang/rust/issues/43784">#43784</a> — if so, I don't see it yet.</p>



<a name="136936197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936197">(Nov 01 2018 at 17:25)</a>:</h4>
<p>it does feel a <em>touch</em> suspicious, but otoh we already require that the impl of <code>Foo&lt;T&gt;</code> must be able to prove that anything implied by the trait is true (and we elaborate those, thanks to your fix for <a href="https://github.com/rust-lang/rust/issues/43784" target="_blank" title="https://github.com/rust-lang/rust/issues/43784">#43784</a>), so by proving <code>Foo&lt;T&gt;</code> we ought to be able to rely on the <code>Foo</code> impl to prove that <code>T: Send</code>, I think?</p>



<a name="136936225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936225">(Nov 01 2018 at 17:25)</a>:</h4>
<p>(And I guess the other key point is that the <code>Foo</code> impl can't rely on the <code>Bar</code> impl, because it has a <code>Self: Foo&lt;T&gt;</code> requirement — <em>that</em> was the real problem in <a href="https://github.com/rust-lang/rust/issues/43784" target="_blank" title="https://github.com/rust-lang/rust/issues/43784">#43784</a> from what I see.)</p>



<a name="136936580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936580">(Nov 01 2018 at 17:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> under the implied bounds setting your translation seems harmless yes</p>



<a name="136936593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936593">(Nov 01 2018 at 17:31)</a>:</h4>
<p>however in rustc, the <code>T: Send</code> is not even elaborated I think</p>



<a name="136936622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936622">(Nov 01 2018 at 17:31)</a>:</h4>
<p>well, we are presently doing that for trait aliases</p>



<a name="136936624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936624">(Nov 01 2018 at 17:31)</a>:</h4>
<p>but not other traits</p>



<a name="136936627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936627">(Nov 01 2018 at 17:31)</a>:</h4>
<p>I'm not sure if we <em>should</em> keep doing it</p>



<a name="136936638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936638">(Nov 01 2018 at 17:32)</a>:</h4>
<p>(just for "consistency")</p>



<a name="136936687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936687">(Nov 01 2018 at 17:32)</a>:</h4>
<p>in that case that might be problematic because my fix for  <a href="https://github.com/rust-lang/rust/issues/43784" target="_blank" title="https://github.com/rust-lang/rust/issues/43784">#43784</a> only proves elaborated bounds, i.e. supertrait and bounds on assoc types</p>



<a name="136936688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936688">(Nov 01 2018 at 17:32)</a>:</h4>
<p>but I guess the same all applies to <code>trait Foo: Send { } trait Bar = Foo;</code></p>



<a name="136936697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936697">(Nov 01 2018 at 17:32)</a>:</h4>
<blockquote>
<p>in that case that might be problematic because my fix for  <a href="https://github.com/rust-lang/rust/issues/43784" target="_blank" title="https://github.com/rust-lang/rust/issues/43784">#43784</a> only prove elaborated bounds, i.e. supertrait and bounds on assoc types</p>
</blockquote>
<p>well, that same function you use to elaborate</p>



<a name="136936703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936703">(Nov 01 2018 at 17:32)</a>:</h4>
<p>is extended to treat trait aliases differently I think?</p>



<a name="136936708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936708">(Nov 01 2018 at 17:32)</a>:</h4>
<p>hmm</p>



<a name="136936715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936715">(Nov 01 2018 at 17:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> in that case that would be ok</p>



<a name="136936720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936720">(Nov 01 2018 at 17:32)</a>:</h4>
<p>but in this case, the <code>T: Send</code> comes from a normal trait..</p>



<a name="136936739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936739">(Nov 01 2018 at 17:33)</a>:</h4>
<p>I can certainly create the example, I dont' think it "went wrong" when I tried it, but maybe I did some step wrong</p>



<a name="136936829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936829">(Nov 01 2018 at 17:34)</a>:</h4>
<p>well, basically, we would only elaborate <code>Bar&lt;T&gt;</code> to <code>Foo&lt;T&gt;</code></p>



<a name="136936839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936839">(Nov 01 2018 at 17:34)</a>:</h4>
<p>so actually know that <code>X: Bar&lt;T&gt;</code> does not imply that <code>T: Send</code> to us</p>



<a name="136936850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936850">(Nov 01 2018 at 17:34)</a>:</h4>
<p>(but also I think you cannot prove that <code>X: Bar&lt;T&gt;</code> unless <code>T: Send</code>)</p>



<a name="136936852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936852">(Nov 01 2018 at 17:34)</a>:</h4>
<p>when you say that the trait alias is translated to <code>impl&lt;Self: Foo&lt;T&gt;&gt; Bar&lt;T&gt; for Self { .. }</code>, I guess there is also a <code>trait Bar&lt;T&gt;: Foo&lt;T&gt;</code> or something?</p>



<a name="136936859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936859">(Nov 01 2018 at 17:35)</a>:</h4>
<p>correct</p>



<a name="136936865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936865">(Nov 01 2018 at 17:35)</a>:</h4>
<p>ok</p>



<a name="136936879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936879">(Nov 01 2018 at 17:35)</a>:</h4>
<p>the funny bit is that this trait</p>



<a name="136936881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936881">(Nov 01 2018 at 17:35)</a>:</h4>
<p>would be an error today</p>



<a name="136936885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936885">(Nov 01 2018 at 17:35)</a>:</h4>
<p>yes</p>



<a name="136936900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936900">(Nov 01 2018 at 17:35)</a>:</h4>
<p>which is why I am <em>tempted</em> (for consistency) to enforce WF conditions</p>



<a name="136936908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936908">(Nov 01 2018 at 17:35)</a>:</h4>
<p>otoh, I can't see why it's <em>important</em> to do so</p>



<a name="136936978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136936978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136936978">(Nov 01 2018 at 17:36)</a>:</h4>
<p>yeah maybe we should enforce them until full implied bounds are implemented</p>



<a name="136937352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937352">(Nov 01 2018 at 17:41)</a>:</h4>
<p>so basically we would check that, assuming the (elaborated) trait alias bounds hold, all the traits bounds are well-formed, just as we do for traits</p>



<a name="136937414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937414">(Nov 01 2018 at 17:42)</a>:</h4>
<p>hence <code>trait Foo = Bar</code> is fine (because <code>Self: Bar =&gt; Self: Bar</code>), but <code>trait Foo&lt;T&gt; = Bar&lt;T&gt;; trait Bar&lt;T: Send&gt; { }</code>  is not, because <code>elaborated(Self: Bar&lt;T&gt;) = [Self: Bar&lt;T&gt;]</code></p>



<a name="136937465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937465">(Nov 01 2018 at 17:43)</a>:</h4>
<p>yes, also I see in the RFC that bounds on type variables are basically left as unresolved</p>



<a name="136937476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937476">(Nov 01 2018 at 17:44)</a>:</h4>
<p>so yeah I'd go for just use the normal elaboration scheme for now</p>



<a name="136937541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937541">(Nov 01 2018 at 17:44)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm not sure I fully understand the above, but I think it kind of depends on whether we want to consider this behaviour as part of the wider implied bounds semantics.</p>



<a name="136937723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937723">(Nov 01 2018 at 17:47)</a>:</h4>
<p>Right I think <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> what <span class="user-mention" data-user-id="131694">@scalexm</span> and I are thinking is that — at least for this PR — it'd be better to make things "consistent" with everything else</p>



<a name="136937741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937741">(Nov 01 2018 at 17:47)</a>:</h4>
<p>(which basically means adding a little code in wfcheck)</p>



<a name="136937747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937747">(Nov 01 2018 at 17:47)</a>:</h4>
<p>so enforce the bounds?</p>



<a name="136937750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937750">(Nov 01 2018 at 17:47)</a>:</h4>
<p>yeah</p>



<a name="136937751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937751">(Nov 01 2018 at 17:47)</a>:</h4>
<p>makes sense to me</p>



<a name="136937770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937770">(Nov 01 2018 at 17:47)</a>:</h4>
<p>right</p>



<a name="136937858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937858">(Nov 01 2018 at 17:48)</a>:</h4>
<p>how do we go about that? is it during selection?</p>



<a name="136937997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136937997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136937997">(Nov 01 2018 at 17:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="136938331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136938331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136938331">(Nov 01 2018 at 17:55)</a>:</h4>
<p>no, it is in <code>wfcheck.rs</code></p>



<a name="136938442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136938442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136938442">(Nov 01 2018 at 17:56)</a>:</h4>
<p>more specifically, <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>, probably just need to <a href="https://github.com/rust-lang/rust/blob/f6e9a6e41cd9b1fb687e296b5a6d4c6ad399f862/src/librustc_typeck/check/wfcheck.rs#L153-L156" target="_blank" title="https://github.com/rust-lang/rust/blob/f6e9a6e41cd9b1fb687e296b5a6d4c6ad399f862/src/librustc_typeck/check/wfcheck.rs#L153-L156">do the same thing for traits and trait aliases here</a></p>



<a name="136938807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136938807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136938807">(Nov 01 2018 at 18:01)</a>:</h4>
<p>oh right</p>



<a name="136938859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136938859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136938859">(Nov 01 2018 at 18:02)</a>:</h4>
<p>never touched this part of the codebase before</p>



<a name="136938863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136938863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136938863">(Nov 01 2018 at 18:02)</a>:</h4>
<p>let me have a look though</p>



<a name="136938931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136938931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136938931">(Nov 01 2018 at 18:03)</a>:</h4>
<p>let's see if that does the trick...</p>



<a name="136939337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939337">(Nov 01 2018 at 18:09)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> incidentally, how does gate-test-X work?</p>



<a name="136939448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939448">(Nov 01 2018 at 18:10)</a>:</h4>
<p>hmm :) I sort of forget</p>



<a name="136939642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939642">(Nov 01 2018 at 18:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yep that works. will push in a second, then you can have a look and r+ hopefully!</p>



<a name="136939827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939827">(Nov 01 2018 at 18:16)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> what do you think about the idea of having a comprehensive list of tests and the files they are in? </p>
<p>Probably living on the tracking issue? Maybe we should make an associated issue for "implementation", since that issue has various comments on it.</p>



<a name="136939832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939832">(Nov 01 2018 at 18:16)</a>:</h4>
<p>I was also thinking it would be nice to add some comments to the rustc-guide</p>



<a name="136939844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939844">(Nov 01 2018 at 18:16)</a>:</h4>
<p>I'd like to have an issue with a checklist describing the open issues we've encountered here</p>



<a name="136939851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939851">(Nov 01 2018 at 18:16)</a>:</h4>
<p>I can do some of that legwork if you want</p>



<a name="136939859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136939859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136939859">(Nov 01 2018 at 18:16)</a>:</h4>
<p>we've basically got a lot of "state" in our heads right now about what works, what doesn't, and why, and I'd like to get that captured before I forget :)</p>



<a name="136940089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940089">(Nov 01 2018 at 18:20)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> sounds fair enough. I've just pushed to the branch now. everything should be passing now. :-) and yes, I'd appreciate if you'd start with some of the legwork... but I'm here to help. especially if you're unsure of anything I've written.</p>



<a name="136940099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940099">(Nov 01 2018 at 18:20)</a>:</h4>
<p>that WF checking was refreshingly trivial</p>



<a name="136940159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940159">(Nov 01 2018 at 18:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm going to have a look at <a href="https://github.com/rust-lang/rust/issues/24010" target="_blank" title="https://github.com/rust-lang/rust/issues/24010">https://github.com/rust-lang/rust/issues/24010</a> now too... since it impacts on trait aliases as well.</p>



<a name="136940357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940357">(Nov 01 2018 at 18:24)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> yes! that would be great. I don't think there's any "deep reason" that this doesn't work</p>



<a name="136940363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940363">(Nov 01 2018 at 18:24)</a>:</h4>
<p>though I've not looked at it in a while</p>



<a name="136940393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940393">(Nov 01 2018 at 18:25)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> also, if you want me to split up the tests in the trait-alias-bounds file into multiple files, I could do that. (the trait-alias-object-types file is already pretty small). just let me know how you'd like to do the splitting, since I'm not totally sure</p>



<a name="136940490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940490">(Nov 01 2018 at 18:26)</a>:</h4>
<p>yeah, I agree, the reason doesn't seem to involve the underlying mechanics of the trait system</p>



<a name="136940517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940517">(Nov 01 2018 at 18:27)</a>:</h4>
<blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> also, if you want me to split up the tests in the trait-alias-bounds file into multiple files, I could do that. (the trait-alias-object-types file is already pretty small). just let me know how you'd like to do the splitting, since I'm not totally sure</p>
</blockquote>
<p>ok, I will have to take a look. Usually the lint for me is if there are lots of supporting types that are only used in one small subpart</p>



<a name="136940621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940621">(Nov 01 2018 at 18:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> that sounds reasonable, but I was hoping to make a more "conceptual" separation.</p>



<a name="136940627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940627">(Nov 01 2018 at 18:29)</a>:</h4>
<p>anyway, prioritise things in the order you want</p>



<a name="136940678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940678">(Nov 01 2018 at 18:30)</a>:</h4>
<p>if you want to start documenting things in the tracking issue and whatnot first, go for that</p>



<a name="136940692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940692">(Nov 01 2018 at 18:30)</a>:</h4>
<p>or indeed review my PR :-)</p>



<a name="136940699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136940699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136940699">(Nov 01 2018 at 18:30)</a>:</h4>
<p>CI hasn't finish quite yet, mind you</p>



<a name="136945059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136945059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136945059">(Nov 01 2018 at 19:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> strange test failure. seen it yet?</p>



<a name="136949479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136949479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136949479">(Nov 01 2018 at 20:56)</a>:</h4>
<p>I see it now, let me take a look</p>



<a name="136949860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136949860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136949860">(Nov 01 2018 at 21:02)</a>:</h4>
<p>sure</p>



<a name="136950119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950119">(Nov 01 2018 at 21:07)</a>:</h4>
<p>I have a hunch, <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>, that the problem lies in <a href="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L525-L530" target="_blank" title="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L525-L530">this code</a>, which applies I think also to <code>TraitAlias</code></p>



<a name="136950124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950124">(Nov 01 2018 at 21:07)</a>:</h4>
<p>I haven't tested that yet though :)</p>



<a name="136950194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950194">(Nov 01 2018 at 21:08)</a>:</h4>
<p>perhaps the same is true <a href="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L1281-L1282" target="_blank" title="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L1281-L1282">here</a>?</p>



<a name="136950207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950207">(Nov 01 2018 at 21:08)</a>:</h4>
<p>ugh, there are more places</p>



<a name="136950221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950221">(Nov 01 2018 at 21:08)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L1605-L1607" target="_blank" title="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L1605-L1607">here</a></p>



<a name="136950234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950234">(Nov 01 2018 at 21:09)</a>:</h4>
<p>(the second place is something else, I have to think about a test case that exposes the problem)</p>



<a name="136950248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950248">(Nov 01 2018 at 21:09)</a>:</h4>
<p>in any case I think we should find some way to write this code differently (that is, the 1st and 3rd links)</p>



<a name="136950259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950259">(Nov 01 2018 at 21:09)</a>:</h4>
<p>instead of testing if this is a trait and adjusting by 1, it would be nice if we could "query" the <code>generics_of</code> the def-id or something</p>



<a name="136950332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950332">(Nov 01 2018 at 21:10)</a>:</h4>
<p>I <em>think</em> we could replace that code with <code>tcx.generics_of(def_id).has_self</code> and it would just work</p>



<a name="136950337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950337">(Nov 01 2018 at 21:10)</a>:</h4>
<p>have to get the right def-id though :)</p>



<a name="136950363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950363">(Nov 01 2018 at 21:11)</a>:</h4>
<p>e.g., in the first case, it would be <code>tcx.hir.local_def_id(item.id)</code></p>



<a name="136950380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950380">(Nov 01 2018 at 21:11)</a>:</h4>
<p>althouhg hmm that might be wrong, because <code>has_self</code> is also true for methods...</p>



<a name="136950393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950393">(Nov 01 2018 at 21:11)</a>:</h4>
<p>ah, but those are a different match arm</p>



<a name="136950464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950464">(Nov 01 2018 at 21:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> what is this code even doing?</p>



<a name="136950553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950553">(Nov 01 2018 at 21:14)</a>:</h4>
<p>/me sighs</p>



<a name="136950569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950569">(Nov 01 2018 at 21:14)</a>:</h4>
<p>actually, I think a <a href="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L1608-L1614" target="_blank" title="https://github.com/rust-lang/rust/blob/451987d86c89b38ddd8c4c124f1b9b6d4ded6983/src/librustc/middle/resolve_lifetime.rs#L1608-L1614">trait alias is impossible in this case</a>, since there are no methods "within" trait aliases (unlike traits + impls)</p>



<a name="136950581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950581">(Nov 01 2018 at 21:14)</a>:</h4>
<p>in any case, the code is computing the index of the lifetime parameters defined on the trait alias and elsewhere</p>



<a name="136950584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950584">(Nov 01 2018 at 21:14)</a>:</h4>
<p>each generic parameter (whether a lifetime or a type) gets an index</p>



<a name="136950600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950600">(Nov 01 2018 at 21:15)</a>:</h4>
<p>in the case of <code>trait Foo</code>, there is also an index assigned to the (implicit) <code>Self</code> type parameter</p>



<a name="136950606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950606">(Nov 01 2018 at 21:15)</a>:</h4>
<p>Ah, and it's trying to handle the index of the lifetime parameter for the self object?</p>



<a name="136950619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950619">(Nov 01 2018 at 21:15)</a>:</h4>
<p>yes, that's the problem, it is adjusting to account for that implicit <code>Self</code></p>



<a name="136950628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950628">(Nov 01 2018 at 21:15)</a>:</h4>
<p>right</p>



<a name="136950635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950635">(Nov 01 2018 at 21:15)</a>:</h4>
<p>I sort of get that</p>



<a name="136950637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950637">(Nov 01 2018 at 21:15)</a>:</h4>
<p>ah way</p>



<a name="136950643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950643">(Nov 01 2018 at 21:15)</a>:</h4>
<p>er, <em>wait</em></p>



<a name="136950654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950654">(Nov 01 2018 at 21:15)</a>:</h4>
<p>I think you can't call <code>tcx.generics_of(...)</code> here</p>



<a name="136950663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950663">(Nov 01 2018 at 21:15)</a>:</h4>
<p>because this code needs to run <em>before</em> <code>generics_of</code></p>



<a name="136950709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950709">(Nov 01 2018 at 21:16)</a>:</h4>
<p>anyway I guess the easiest fix for now (ugh) is to add <code>TraitAlias</code> into the match statements (or convert <code>if let</code> to <code>match</code>)</p>



<a name="136950711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950711">(Nov 01 2018 at 21:16)</a>:</h4>
<p>it'd be nice to do something cleaner though</p>



<a name="136950718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950718">(Nov 01 2018 at 21:16)</a>:</h4>
<p>I can't add it to the code in the first link either?</p>



<a name="136950723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950723">(Nov 01 2018 at 21:16)</a>:</h4>
<p>but honestly <code>resolve_lifetime</code> is kind of a mess that we've been meaning to refactor for some time</p>



<a name="136950726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950726">(Nov 01 2018 at 21:16)</a>:</h4>
<blockquote>
<p>I can't add it to the code in the first link either?</p>
</blockquote>
<p>why not?</p>



<a name="136950732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950732">(Nov 01 2018 at 21:16)</a>:</h4>
<p>I'm just checking. I thought I could.</p>



<a name="136950739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950739">(Nov 01 2018 at 21:17)</a>:</h4>
<p>yeah, I think you should</p>



<a name="136950744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950744">(Nov 01 2018 at 21:17)</a>:</h4>
<p>I don't want to get bogged down in refactoring the whole thing heh</p>



<a name="136950747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950747">(Nov 01 2018 at 21:17)</a>:</h4>
<p>and I <em>think</em> that's the bug,</p>



<a name="136950761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950761">(Nov 01 2018 at 21:17)</a>:</h4>
<p>that's why it's getting those "index out of bound" errors</p>



<a name="136950764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950764">(Nov 01 2018 at 21:17)</a>:</h4>
<p>because the index is off by 1 :)</p>



<a name="136950787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950787">(Nov 01 2018 at 21:17)</a>:</h4>
<p>\Region parameter out of range when substituting in region 'a</p>



<a name="136950789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950789">(Nov 01 2018 at 21:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> should I be consistent and use a match in both cases though?</p>



<a name="136950791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950791">(Nov 01 2018 at 21:17)</a>:</h4>
<p>(perhaps factoring it out into a function)</p>



<a name="136950879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136950879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136950879">(Nov 01 2018 at 21:19)</a>:</h4>
<p>yeah, a helper fn would be good</p>



<a name="136951077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136951077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136951077">(Nov 01 2018 at 21:22)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> wait, why doesn't the self lifetime come first for impl items?</p>



<a name="136951404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136951404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136951404">(Nov 01 2018 at 21:28)</a>:</h4>
<p>/me compiles</p>



<a name="136952616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136952616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136952616">(Nov 01 2018 at 21:49)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> well, it seems to work... not sure why the case of <code>ItemKind::Impl</code> isn't needed though</p>



<a name="136952855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136952855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136952855">(Nov 01 2018 at 21:53)</a>:</h4>
<p>anyway, see my push. ready to review I think. :-)</p>



<a name="136965810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136965810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136965810">(Nov 02 2018 at 03:05)</a>:</h4>
<p>As for solving the other issue, I think the key to it is the <code>create_substs_for_ast_trait_ref</code> fn</p>



<a name="136966229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/136966229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#136966229">(Nov 02 2018 at 03:16)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> or it might be better to make the change in <code>instantiate_poly_trait_ref_inner</code>... not sure. what's the diff between a mono and poly trait ref?</p>



<a name="137034881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137034881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137034881">(Nov 02 2018 at 14:22)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> I'll have to look, some of those routines are general purpose. We want to find the right place that is specific to trait objects.</p>



<a name="137034977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137034977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137034977">(Nov 02 2018 at 14:22)</a>:</h4>
<p>a "mono trait ref" refers to something like <code>T: Foo&lt;U&gt;</code> -- i.e., a particular trait with some specific type and lifetime parameters</p>



<a name="137035030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137035030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137035030">(Nov 02 2018 at 14:22)</a>:</h4>
<p>a "poly trait ref" refers to a "higher-ranked" trait ref, e.g., <code>for&lt;'a&gt; T: Foo&lt;'a&gt;</code></p>



<a name="137035049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137035049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137035049">(Nov 02 2018 at 14:22)</a>:</h4>
<p>the Poly refers to the <code>for</code> binder</p>



<a name="137035093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137035093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137035093">(Nov 02 2018 at 14:23)</a>:</h4>
<p>(so this defines <em>many</em> trait references)</p>



<a name="137062530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137062530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137062530">(Nov 02 2018 at 16:06)</a>:</h4>
<p>Aha</p>



<a name="137062545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137062545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137062545">(Nov 02 2018 at 16:06)</a>:</h4>
<p>Fair</p>



<a name="137062672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137062672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137062672">(Nov 02 2018 at 16:06)</a>:</h4>
<p>But everything gets converted to a PolyTraitRef in the end right?</p>



<a name="137062942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137062942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137062942">(Nov 02 2018 at 16:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> and yes, I was trying to make the change to the most specifuc site...not 100% sure where.</p>



<a name="137067741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137067741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137067741">(Nov 02 2018 at 17:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> any ideas?</p>



<a name="137072973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137072973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137072973">(Nov 02 2018 at 18:23)</a>:</h4>
<p>I sent one thought earlier but I will re-investigate</p>



<a name="137080608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137080608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137080608">(Nov 02 2018 at 20:32)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> </p>
<p>btw I asked this on that PR but maybe we can discuss it here =)</p>
<blockquote>
<p>Remind me btw why we pushed the "expansion" into the lowering step, versus defining a proper WellFormed(T) goal? (And then having struct Box&lt;T&gt; get to assume that WellFormed(T) in its "environment"?)</p>
</blockquote>



<a name="137080732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137080732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137080732">(Nov 02 2018 at 20:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> we had infinite branches problem at some time, not sure if it is still the case</p>



<a name="137080841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137080841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137080841">(Nov 02 2018 at 20:36)</a>:</h4>
<p>well I think we won't have them anymore now with the <code>FromEnv / WF</code> setup</p>



<a name="137081086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137081086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137081086">(Nov 02 2018 at 20:41)</a>:</h4>
<p>I think there were other problems maybe with associated types because they interacted with traits, I don't remember, but I think another point is that it enabled an optimization to be sound, which is that if you have <code>type Type&lt;...&gt; where WC</code> you only have <code>WF(Type&lt;...&gt;) :- WC</code> not <code>WF(Type&lt;...&gt;) :- WellFormed(WC)</code></p>



<a name="137081175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137081175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137081175">(Nov 02 2018 at 20:42)</a>:</h4>
<p>well I'll find some time to think about it again, maybe now we can have the expansion in the logical rules again :) but if it works out, it'll be an easy change so let's keep the guide like that for now (this is how it is implemented in chalk and rustc_traits currently)</p>



<a name="137081223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/implied-bounds/near/137081223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/implied-bounds.html#137081223">(Nov 02 2018 at 20:43)</a>:</h4>
<p>Yep.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>